import { wsUrl } from "../config/config.js"

let WS = {}
let isWsOpen = false

// 连接websocket
function initWebsocket() {
	WS = uni.connectSocket({
		url: wsUrl,
		header: {},
		protocols: [],
		complete:function(info){
			console.log(info)
		}
	})
}

// 打开websocket
function openWebsocket() {
	uni.onSocketOpen(function(res) {
		console.log(res)
	})
}

export {
	initWebsocket,
	openWebsocket
}